import Vue from 'vue';

import VueRouter from "vue-router";

Vue.use(VueRouter);

import {staticRouter} from "@/router/router.conf"

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [...staticRouter.loginRouter, ...staticRouter.defaultRouter, ...staticRouter.errorRouter]
});

router.beforeEach((to, from, next) => {
    if (to.meta.title) {
      document.title = to.meta.title;
    }
    next();
  }
);

export default router;


